package com.mmd.base.utils;


import cn.hutool.core.thread.ExecutorBuilder;
import cn.hutool.core.thread.ThreadFactoryBuilder;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadFactory;

/**
 * 线程池工具类
 */
public class ExecutorServiceUtil {

    public static final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNamePrefix("redis-delay-job").build();

    public static final ExecutorService executorService = ExecutorBuilder.create()
            .setCorePoolSize(16)
            .setMaxPoolSize(16)
            .setKeepAliveTime(0)
            .setWorkQueue(new ArrayBlockingQueue(500))
            .setThreadFactory(threadFactory)
            .build();
}
